package com.cn.wanxi.util;

public class Tool {
    public static Float stringToFloat(String value) {
        try {
            return Float.parseFloat(value);
        } catch (Exception e) {
//            e.printStackTrace();
        }
        return 0.0f;
    }

    public static Integer stringToInt(String value) {
        try {
            return Integer.parseInt(value);
        } catch (Exception e) {

        }
        return 0;
    }

    public static String emptyString(String value) {
        return value == null ? "" : value;
    }

    public static Integer stringToCurPage(String value) {
        try {
            return Integer.parseInt(value);
        } catch (Exception e) {

        }
        return 1;
    }

    public static Integer stringToPageSize(String value) {
        try {
            return Integer.parseInt(value);
        } catch (Exception e) {

        }
        return 10;
    }
}
